home *** CD-ROM | disk | FTP | other *** search
/ DarkBASIC - The Ultimate 3D Game Creator / PCactive 8 CD1 - DarkBasic.iso / SOFTWARE / DEMOS / DarkForge2000 / pixelstorm / pixelstorm.dba next >
Encoding:
Text File  |  2000-04-09  |  1.5 KB  |  92 lines

  1. ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  2. `              PixelStorm
  3. ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  4. ` By Rich Davey (rich@fatal-design.com)
  5. ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  6. ` My thanks  to  Madonna  for providing
  7. ` the music during the coding of this !
  8. ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  9.  
  10. sync rate 60
  11. sync on
  12. hide mouse
  13.  
  14. ` Play with the snow value for some rather cool effects!
  15.  
  16. snow=75; levels=6; w=256; h=256
  17.  
  18. create bitmap 1,256,256
  19.  
  20. dim sx(snow)
  21. dim sy(snow)
  22.  
  23. for t=0 to snow
  24.     sx(t)=rnd(w)
  25.     sy(t)=rnd(h)
  26. next t
  27.  
  28. for o=1 to levels
  29.     make object cube o,o*10
  30.     ghost object on o
  31.     set object o,1,1,0,0
  32.     rotate object o,180,0,0
  33.     fix object pivot o
  34. next o
  35.  
  36. position camera 0,0,-10
  37.  
  38. color backdrop rgb(0,0,50)
  39. set ambient light 90
  40.  
  41. do
  42.  
  43.     set current bitmap 1
  44.  
  45.     for t=0 to snow
  46.  
  47.         if sy(t)=h then sy(t)=0
  48.  
  49.         v=rnd(15)+1
  50.  
  51.         ink rgb(0,0,0),1
  52.         dot sx(t),sy(t)
  53.  
  54.         if v<6 then sx(t)=sx(t)+1
  55.         if v>10 then sx(t)=sx(t)-1
  56.  
  57.         sy(t)=sy(t)+1
  58.  
  59.         if sy(t)>h then sy(t)=h
  60.  
  61.         if pixelstorm=1
  62.             ink rgb(0,255,0),1
  63.         else
  64.             ink rgb(255,255,255),1
  65.         endif
  66.  
  67.         dot sx(t),sy(t)
  68.  
  69.     next t
  70.  
  71.     get image 1,0,0,256,256
  72.     set current bitmap 0
  73.  
  74.     for o=1 to levels
  75.         texture object o,1
  76.     next o
  77.  
  78.     xrotate object 1,wrapvalue(ox+5)
  79.     yrotate object 2,wrapvalue(ox+10)
  80.     zrotate object 3,wrapvalue(ox+15)
  81.     yrotate object 4,wrapvalue(ox+20)
  82.     xrotate object 5,wrapvalue(ox+25)
  83.  
  84.     inc ox
  85.  
  86.     if spacekey()=1 then pixelstorm=1
  87.  
  88.     sync
  89.  
  90. loop
  91.  
  92.